<template>
  <!-- 头部导航 -->
  <div class="box">
    <el-card>
      <div class="top">
        <div class="top1">
          <span> 学员管理 </span>
        </div>
        <div class="top2">
          <el-button
            type="primary"
            style=""
            plain
            class="el-icon-circle-plus"
            @click="dialogFormVisible = true"
          >
            添加学员</el-button
          >
        </div>
        <div class="top2">
          <el-button
            type="success"
            style=""
            plain
            class="el-icon-folder-add"
            @click="course"
          >
            添加排课</el-button
          >
        </div>
        <div class="top2">
          <el-button
            type="warning"
            style=""
            plain
            class="el-icon-delete"
            @click="psstuden"
          >
            删除</el-button
          >
        </div>
        <div class="top22">
          <div style="margin-top: 10px">
            <el-input
              placeholder="请输入内容"
              v-model="queryinfo.name"
              class="input-with-select"
            >
              <template #prepend>
                <el-select
                  v-model="formaa.name"
                  @change="buhui"
                  style="width: 150px"
                  placeholder="请选择"
                >
                  <el-option
                    v-for="item in studentsousuo"
                    :key="item.id"
                    :label="item.name"
                    :value="item.id"
                  ></el-option>
                </el-select>
              </template>
              <template #append>
                <el-button
                  icon="el-icon-search"
                  @click="studentList"
                ></el-button>
              </template>
            </el-input>
          </div>
        </div>
      </div>
    </el-card>
    <el-card>
      <el-card>
        <!-- 列表 -->
        <el-table
          ref="multipleTable"
          :data="student"
          tooltip-effect="dark"
          style="width: 100%"
          @selection-change="handleSelectionChange"
        >
          <!-- @selection-change="handleSelectionChange" -->
          <el-table-column type="selection" width="50"> </el-table-column>
          <div class="el-icon-heavy-rain"></div>
          <!-- <el-table-column width="45"> -->
          <!-- <template #default="scope">
              <div></div>
            </template> -->
          <!-- </el-table-column> -->
          <el-table-column prop="name" label="学员姓名" width="180">
            <template #default="scope">
              <div>
                <img
                  style="width: 30px; height: 30px; border-radius: 5px"
                  :src="
                    'https://api.eshareedu.cn/edusystems/upload/' +
                    scope.row.photo
                  "
                  alt=""
                />&nbsp;&nbsp;&nbsp;{{ scope.row.name }}
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="sex" label="性别" width="100">
            <template v-slot:default="scopen">
              {{ scopen.row.sex ? "男" : "女" }}
            </template>
          </el-table-column>
          <el-table-column
            width="130"
            prop="birthday"
            label="生日"
            show-overflow-tooltip
          >
          </el-table-column>
          <el-table-column
            prop="age"
            label="年龄"
            show-overflow-tooltip
            width="70"
          >
          </el-table-column>
          <el-table-column
            prop="addtime"
            label="入学时间"
            show-overflow-tooltip
            width="200"
          >
          </el-table-column>
          <el-table-column
            prop="stateName"
            label="状态"
            width="130"
            show-overflow-tooltip
          >
            <template #default="scope">
              <el-button
                class="buttonzt"
                style="border: none"
                v-model="scope.row.stateName"
                @click="wan(scope.row)"
                >{{ scope.row.stateName }}
              </el-button>
            </template>
          </el-table-column>
          <el-table-column
            prop=""
            label="课时消耗"
            width="200"
            show-overflow-tooltip
          >
            <template #default="scope">
              <div
                v-for="item in scope.row.orderList"
                :key="item.id"
                style="
                  width: 300px;
                  height: 25px;
                  background-color: ;
                  display: flex;
                "
              >
                <span
                  class="aaa"
                  style="font-size: 12px; color: #333; line-height: 30px"
                  >{{ item.courseName }}</span
                >
                <div
                  style="
                    width: 90px;
                    height: 4px;
                    background-color: #ebeef5;
                    margin-top: 13px;
                    margin-left: 8px;
                    border-radius: 100px;
                  "
                ></div>
                <span
                  class="bbb"
                  style="
                    line-height: 30px;
                    font-size: 12px;
                    color: #333333;
                    margin-left: 8px;
                  "
                  >剩{{ item.coursecounts }}</span
                >
              </div>
            </template>
          </el-table-column>
          <el-table-column
            prop=""
            label="操作"
            width="400"
            show-overflow-tooltip
          >
            <template #default="scope">
              <el-row>
                <div class="nan1" @click="gouke(scope.row.id)">购课</div>
                <div class="nan2">记录</div>
                <div class="nan2" @click="studenedit(scope.row)">编辑</div>
                <div class="nan2" @click="studentDelete(scope.row.id)">
                  删除
                </div>
                <div class="nan2" @click="kebiao(scope.row)">课表</div>
              </el-row>
            </template>
          </el-table-column>
        </el-table>
        <!-- 列表 -->
        <!-- 分页 -->
        <div class="block">
          <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="queryinfo.page"
            :page-sizes="[1, 8, 15]"
            :page-size="queryinfo.psize"
            layout="total, sizes, prev, pager, next, jumper"
            :total="total"
          >
          </el-pagination>
        </div>
        <!-- 分页 -->
      </el-card>
    </el-card>
    <!-- 添加 -->
    <el-dialog title="添加学员" width="40%" v-model="dialogFormVisible">
      <div style="margin: 20px"></div>
      <el-form
        :label-position="labelPositiona"
        label-width="80px"
        :model="addform"
        :rules="rules"
        ref="inserform"
      >
        <el-form-item label="名称" prop="name">
          <el-input style="width: 300px" v-model="addform.name"></el-input>
        </el-form-item>
        <el-form-item label="联系方式" prop="tel">
          <el-input style="width: 300px" v-model="addform.tel"></el-input>
        </el-form-item>
        <el-form-item label="性别">
          <el-radio-group v-model="addform.sex">
            <el-radio :label="1">男</el-radio>
            <el-radio :label="0">女</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="班级">
          <el-select v-model="addform.companyid" placeholder="请选择班级">
            <el-option
              v-for="item in studentsousuo"
              :key="item.id"
              :label="item.name"
              :value="item.id"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="出生日期" prop="birthday">
          <!-- <el-col :span="11"> -->
            <el-date-picker
            type="date"
            placeholder="选择日期"
            v-model="addform.birthday"
            format="YYYY 年 MM 月 DD 日"
            value-format="YYYY/MM/DD"
          ></el-date-picker>
          <!-- </el-col> -->
        </el-form-item>
        <el-form-item label="学员编号" prop="num">
          <el-input style="width: 300px" v-model="addform.num"></el-input>
        </el-form-item>
        <el-form-item style="width: 400px" label="备注" prop="remarks">
          <el-input type="textarea" v-model="addform.remarks"></el-input>
        </el-form-item>
      </el-form>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="dialogFormVisible = false">取 消</el-button>
          <el-button type="primary" @click="studentform('inserform')"
            >确 定</el-button
          >
        </span>
      </template>
    </el-dialog>
    <!-- 添加 -->
    <!-- 修改学员 -->
    <el-dialog title="修改学员" width="40%" v-model="dialogFormVisibles">
      <div style="margin: 20px"></div>
      <el-form
        :label-position="labelPositiona"
        label-width="80px"
        :model="editform"
        :rules="rules"
        ref="inserform"
      >
        <el-form-item label="名称" prop="name">
          <el-input style="width: 300px" v-model="editform.name"></el-input>
        </el-form-item>
        <el-form-item label="联系方式" prop="tel">
          <el-input style="width: 300px" v-model="editform.tel"></el-input>
        </el-form-item>
        <el-form-item label="性别">
          <el-radio-group v-model="editform.sex">
            <el-radio :label="1">男</el-radio>
            <el-radio :label="0">女</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="出生日期" prop="birthday">
          <!-- <el-col :span="11"> -->
            <el-date-picker
            type="date"
            placeholder="选择日期"
            v-model="editform.birthday"
            format="YYYY 年 MM 月 DD 日"
            value-format="YYYY/MM/DD"
          ></el-date-picker>
          <!-- </el-col> -->
        </el-form-item>
        <el-form-item label="学员编号" prop="num">
          <el-input style="width: 300px" v-model="editform.num"></el-input>
        </el-form-item>
        <el-form-item style="width: 400px" label="备注" prop="remarks">
          <el-input type="textarea" v-model="editform.remarks"></el-input>
        </el-form-item>
      </el-form>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="dialogFormVisibles = false">取 消</el-button>
          <el-button type="primary" @click="studentedit('inserform')"
            >确 定</el-button
          >
        </span>
      </template>
    </el-dialog>
    <!-- 修改学员 -->
    <!-- 课表 -->
    <el-dialog title="课表" width="90%" v-model="dialogFormVisiblec">
      <div style="margin: 10px"></div>
      <!-- <div class="boxcenter">
        <div class="aaa">

        </div> -->
      <div class="sss">
        <!-- left -->
        <div class="kebiao1">
          <div class="kb-left">
            <span>学员信息</span>
          </div>
          <div class="kb-lefta">
            <ul>
              <li class="frist">
                <div class="left-img">
                  <img
                    :src="
                      'https://api.eshareedu.cn/edusystems/upload/' +
                      kbiao.photo
                    "
                    alt=""
                  />
                </div>
                <span>{{ kbiao.name }}</span>
              </li>
              <li class="frist2">
                <span
                  >状态：<button>{{ kbiao.stateName }}</button></span
                >
              </li>
              <li class="acc">学员编程：{{ kbiao.remarks }}</li>
              <li class="acc">手机号：{{ kbiao.tel }}</li>
              <li class="acc">性别：{{ kbiao.sex == 1 ? "男" : "女" }}</li>
              <li class="acc">生日：{{ kbiao.birthday }}</li>
              <li class="acc">入学时时间：{{ kbiao.addtime }}</li>
            </ul>
          </div>
          <div class="kb-leftb">
            <div class="leftb-biaoti">购买课程</div>
            <div
              class="kb-leftc"
              v-for="item in kbiao.orderList"
              :key="item.id"
            >
              <div class="leftc1">{{ item.courseName }}</div>
              <div class="leftc2">
                <div class="left22"></div>
              </div>
              <div class="leftc3">
                <span>购买{{ item.coursecounts }}</span>
                <span>剩余{{ item.coursecounts }}</span>
              </div>
            </div>
          </div>
        </div>
        <!-- left -->
        <!-- right -->
        <div class="kebiaorl">
          <div class="kebiaorl1">
            <el-tabs v-model="activeName" @tab-click="handleClick">
              <el-tab-pane label="单次排课" name="first"
                ><div class="rili">
                  <el-calendar v-model="value">
                    <template #dateCell="data">
                      <div>
                        <div style="margin-left: 50px">
                          {{ data.data.day.substr(8, 2) }}
                        </div>
                        <div v-for="item in zong" :key="item.i">
                          <div v-if="item.coursedate == data.data.day">
                            <div class="acca">
                              <div class="accb"></div>
                              <div class="accc">
                                <div class="accd">{{ item.coursename }}</div>
                                <div class="accd2">
                                  <span>{{
                                    item.starttime.substr(10, 6)
                                  }}</span>
                                  <span>{{ item.teachername }}</span>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </template>
                  </el-calendar>
                </div></el-tab-pane
              >
              <el-tab-pane label="批量排课" name="second"
                >啥也不是................</el-tab-pane
              >
            </el-tabs>
          </div>
        </div>
        <!-- right -->
      </div>
      <!-- </div> -->
      <template #footer>
        <span class="dialog-footer">
          <el-button type="primary" @click="classedit('inserform')"
            >确 定</el-button
          >
          <el-button @click="dialogFormVisiblec = false">取 消</el-button>
        </span>
      </template>
    </el-dialog>
    <!-- 课表 -->
    <!-- 购课 -->
    <el-dialog title="购课" width="61.9%" v-model="dialogFormVisibleb">
      <div style="margin: 20px"></div>
      <el-form
        :label-position="labelPosition"
        label-width="80px"
        :model="gkform"
        :rules="rules"
        ref="inserform"
      >
        <div class="audit">
          <div class="audita">
            <div class="audita1">
              <div class="nan2">
                <el-form-item label="">
                  <span>合约类型</span>
                  <el-radio-group v-model="gkform.ordertype">
                    <el-radio label="课时卡">课时卡</el-radio>
                    <el-radio label="时段卡">时段卡</el-radio>
                  </el-radio-group>
                </el-form-item>
              </div>
            </div>
            <div class="audita1">
              <div class="nan2">
                <el-form-item label="">
                  <span><font color="red">*</font> 签约日期</span>
                  <el-date-picker
                    v-model="gkform.beigindate"
                    type="date"
                    placeholder="选择日期"
                    format="YYYY 年 MM 月 DD 日"
                    value-format="YYYY/MM/DD"
                    style="width: 150px"
                  ></el-date-picker>
                </el-form-item>
              </div>
            </div>
            <div class="audita1">
              <div class="nan2">
                <el-form-item label="">
                  <span>结束日期</span>
                  <el-date-picker
                    v-model="gkform.enddate"
                    type="date"
                    placeholder="选择日期"
                    format="YYYY 年 MM 月 DD 日"
                    value-format="YYYY/MM/DD"
                    style="width: 150px"
                  ></el-date-picker>
                </el-form-item>
              </div>
            </div>
          </div>
          <div class="audita">
            <div class="audita1">
              <div class="nan2">
                <el-form-item label="">
                  <span><font color="red">*</font> 签约课程</span>
                  <el-select
                    placeholder="请选择课程"
                    v-model="gkform.courseid"
                    style="width: 150px"
                  >
                    <el-option
                      v-for="item in audit"
                      :key="item.id"
                      :label="item.name"
                      :value="item.id"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </div>
            </div>
            <div class="audita1">
              <div class="nan2">
                <el-form-item label="">
                  <span>课时数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                  <el-input
                    min="1"
                    @change="qian"
                    v-model="gkform.coursecounts"
                    type="number"
                    placeholder=" "
                    style="width: 150px"
                  ></el-input>
                </el-form-item>
              </div>
            </div>
            <div class="audita1">
              <div class="nan2">
                <el-form-item label="">
                  <span>课程单价</span>
                  <el-input
                    min="1"
                    @change="qian"
                    v-model="gkform.price"
                    type="number"
                    placeholder=" "
                    style="width: 150px"
                  ></el-input>
                </el-form-item>
              </div>
            </div>
            <div class="audita1">
              <div class="nan2">
                <el-form-item label="">
                  <span><font color="red">*</font> 课程金额</span>
                  <el-input
                    min="1"
                    @change="qiana"
                    v-model="gkform.sumprice"
                    type="number"
                    placeholder=" "
                    style="width: 150px"
                  ></el-input>
                </el-form-item>
              </div>
            </div>
          </div>
          <div class="audita">
            <div class="audita1">
              <div class="nan2">
                <el-form-item label="">
                  <span>折扣方式</span>
                  <el-radio-group v-model="gkform.discounttype">
                    <el-radio label="直减" @change="button110"
                      >直减&nbsp;&nbsp;&nbsp;</el-radio
                    >
                    <el-radio label="折扣" @change="button220">折扣</el-radio>
                  </el-radio-group>
                </el-form-item>
              </div>
            </div>
            <div class="audita1" v-show="abc1">
              <div class="nan2">
                <el-form-item label="">
                  <span>优惠金额</span>
                  <el-input
                    v-model="gkform.discountprice"
                    placeholder=" "
                    style="width: 150px"
                    @change="qiana"
                  ></el-input>
                </el-form-item>
              </div>
            </div>
            <div class="audita1" v-show="abc2">
              <div class="nan2">
                <el-form-item label="">
                  <span>优惠折扣</span>
                  <el-input
                    v-model="gkform.discountper"
                    placeholder=" "
                    style="width: 150px"
                  ></el-input>
                  %
                </el-form-item>
              </div>
            </div>
          </div>
          <div class="audita111">
            <div class="audita1">
              <div class="nan2">
                <el-form-item label="">
                  <span>备注&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                  <el-input
                    v-model="gkform.remarks"
                    type="textarea"
                    style="width: 400px; height: 50px"
                  ></el-input>
                </el-form-item>
              </div>
            </div>
          </div>
        </div>
        <div class="buhuia">
          <div class="zhenbuhui">
            总金额：<span>￥{{ zhijian }}</span>
          </div>
          <div class="zhenbuhui">
            已优惠：<span>￥{{ youhui }}</span>
          </div>
        </div>
      </el-form>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="dialogFormVisibleb = false">取 消</el-button>
          <el-button type="primary" @click="shuai('inserform')"
            >确 定</el-button
          >
        </span>
      </template>
    </el-dialog>
    <!-- 购课 -->
    <!-- 学员修改状态 -->
    <el-dialog title="" width="50%" v-model="dialogFormVisiblebb">
      <div style="margin: 20px"></div>
      <el-form
        :label-position="labelPosition"
        label-width="80px"
        :model="gbzt"
        :rules="rules"
        ref="inserform"
      >
        <el-form-item label="">
          <div class="nangao">{{ gbzt.name }}</div>
          <el-radio-group v-model="gbzt.state">
            <div class="acc" style="color: #000">
              <el-radio label="1">未报名</el-radio>
              <el-radio label="2">已报名</el-radio>
              <el-radio label="3">已毕业</el-radio>
              <el-radio label="4">流失</el-radio>
            </div>
          </el-radio-group>
        </el-form-item>
      </el-form>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="dialogFormVisiblebb = false">取 消</el-button>
          <el-button type="primary" @click="editzt('inserform')"
            >确 定</el-button
          >
        </span>
      </template>
    </el-dialog>
    <!-- 学员修改状态 -->
    <!-- 学员排课 -->
    <el-dialog title="排课" width="80%" v-model="dialogFormVisibleabc">
      <div style="margin: 10px"></div>
      <el-tabs
        v-model="activeName"
        type="card"
        :before-leave="nihaoa"
        @tab-click="handleClick"
      >
        <!-- 插班排课 -->
        <el-tab-pane label="插板排课" name="first">
          <div
            style="
              margin-top: 15px;
              width: 270px;
              height: 50px;
              margin-left: 15px;
            "
          >
            <el-input
              placeholder="请输入关键字"
              v-model="input3"
              class="input-with-select"
            >
              <template #append>
                <el-button icon="el-icon-search"></el-button>
              </template>
            </el-input>
          </div>
          <el-table
            :data="tableData"
            style="width: 100%"
            :row-class-name="tableRowClassName"
          >
            <el-table-column prop="name" label="班级名称" width="200">
              <template #default="scope">
                <el-radio
                  v-model="radio"
                  @change="szyzs(scope.row)"
                  :label="scope.row.name"
                ></el-radio>
              </template>
            </el-table-column>
            <el-table-column prop="coursename" label="课程" width="140">
            </el-table-column>
            <el-table-column prop="teacherslist" label="老师" width="140">
            </el-table-column>
            <el-table-column prop="students" label="人数" width="130">
            </el-table-column>
            <el-table-column prop="schcourses" label="计划课时" width="140">
            </el-table-column>
            <el-table-column prop="endcourses" label="已排课时" width="140">
            </el-table-column>
            <el-table-column prop="coursecounts" label="已上课时" width="140">
            </el-table-column>
            <el-table-column prop="address" label="操作" width="140"
              >课表</el-table-column
            >
          </el-table>
          <div class="dialog-footer">
            <el-button type="primary" @click="banjipk('inserform')"
              >保存</el-button
            >
          </div>
        </el-tab-pane>
        <!-- 插班排课 -->
        <!-- 一对一排课 -->
        <el-tab-pane label="一对一排课" name="second">
          <!-- 批量排课 -->
          <el-row>
            <el-form
              :inline="true"
              class="demo-form-inline"
              :label-position="labelPosition"
              :model="oneform"
            >
              <div class="aabbcc">
                <div class="nan2">
                  <el-form-item size="medium">
                    <div style="margin-bottom: 5px">
                      <span>签约课程</span>
                    </div>
                    <el-select
                      placeholder="请选择课程"
                      v-model="oneform.courseid"
                      style="width: 150px"
                    >
                      <el-option
                        v-for="item in audit"
                        :key="item.id"
                        :label="item.name"
                        :value="item.id"
                      ></el-option>
                    </el-select>
                  </el-form-item>
                </div>
              </div>
              <div class="nan">
                <div class="nan2">
                  <el-form-item size="medium">
                    <div style="margin-bottom: 5px">
                      <span><font color="red">*</font> 主教老师</span
                      >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
                        @click="none"
                        style="color: #15b0ff; cursor: pointer"
                        >添加助教</span
                      >
                    </div>

                    <el-select
                      placeholder="请选择"
                      v-model="oneform.teacherid"
                      style="width: 150px"
                    >
                      <el-option
                        v-for="item in teacher1"
                        :key="item.id"
                        :label="item.name"
                        :value="item.id"
                      ></el-option>
                    </el-select>
                  </el-form-item>
                </div>
                <div class="nan2" v-show="buhuigao">
                  <el-form-item size="medium">
                    <div style="margin-bottom: 5px">
                      <span>助教老师</span>
                    </div>

                    <el-select
                      placeholder="请选择"
                      v-model="oneform.assistant"
                      style="width: 150px"
                    >
                      <el-option
                        v-for="item in teacher2"
                        :key="item.id"
                        :label="item.name"
                        :value="item.id"
                      ></el-option>
                    </el-select>
                  </el-form-item>
                </div>
                <div class="nan2">
                  <el-form-item label="" size="medium">
                    <div style="margin-bottom: 5px"><span>教室</span></div>
                    <el-select
                      placeholder="请选择"
                      v-model="oneform.classrooms"
                      style="width: 150px"
                    >
                      <el-option
                        v-for="item in class1"
                        :key="item.id"
                        :label="item.name"
                        :value="item.id"
                      ></el-option>
                    </el-select>
                  </el-form-item>
                </div>
                <div class="nan2">
                  <el-form-item label="" size="medium">
                    <div style="margin-bottom: 4px">
                      <span><font color="red">*</font> 单节课扣学员课时</span>
                    </div>
                    <el-input
                      v-model="oneform.pricecounts"
                      placeholder=""
                      style="width: 150px"
                    ></el-input>
                  </el-form-item>
                </div>
              </div>
              <div class="nana">
                <el-menu
                  :default-active="activeIndex"
                  class="el-menu-demo"
                  mode="horizontal"
                  @select="handleSelect"
                  text-color="#333"
                  active-text-color="#0074d9"
                >
                  <el-menu-item
                    index="1"
                    style="font-size: 15px"
                    @click="none11"
                    v-model="oneform.addtype"
                    >单次排课</el-menu-item
                  >
                  <el-menu-item
                    index="2"
                    style="font-size: 15px"
                    @click="none1"
                    v-model="oneform.addtype"
                    >批量排课</el-menu-item
                  >
                </el-menu>
              </div>
              <div class="nanb">
                <div class="nan2">
                  <el-form-item label="" required>
                    <span style="color: #000000; font-size: 15px"
                      >开课日期</span
                    >
                    <el-date-picker
                      v-model="oneform.begindate"
                      type="date"
                      format="YYYY 年 MM 月 DD 日"
                      value-format="YYYY/MM/DD"
                      placeholder="选择日期"
                      style="width: 150px"
                    ></el-date-picker>
                  </el-form-item>
                </div>
                <div class="nan2" v-show="buhui1">
                  <el-form-item label="">
                    <span style="color: #000000; font-size: 15px"
                      >结束方式</span
                    >
                    <el-radio-group v-model="oneform.jsfs">
                      <el-radio label="按课节" @click="button1"
                        >按课节</el-radio
                      >
                      <el-radio label="按日期" @click="button2"
                        >按日期</el-radio
                      >
                    </el-radio-group>
                  </el-form-item>
                </div>
                <div class="nan2" v-show="buhui2">
                  <el-form-item label="" size="medium">
                    <div style="margin-bottom: 4px">
                      <span style="color: #000000; font-size: 15px"
                        ><font color="red">*</font> 排课总数</span
                      >
                    </div>
                    <el-input
                      v-model="oneform.coursescount"
                      placeholder=""
                      style="width: 150px"
                    ></el-input>
                  </el-form-item>
                </div>
                <div class="nan2" v-show="jieshu">
                  <el-form-item label="" required>
                    <span style="color: #000000; font-size: 15px"
                      >结课日期</span
                    >
                    <el-date-picker
                      v-model="oneform.enddate"
                      type="date"
                      format="YYYY 年 MM 月 DD 日"
                      value-format="YYYY/MM/DD"
                      placeholder="选择日期"
                      style="width: 150px"
                    ></el-date-picker>
                  </el-form-item>
                </div>
              </div>
              <div class="nanc" v-show="nangao1">
                <div class="nanzi"><font color="red">*</font> 上课时间</div>
                <div class="nan2" style="margin-left: 0px">
                  <el-form-item label="" required v-model="oneform.weektime">
                    <el-col :span="11">
                      <el-form-item prop="date1">
                        <el-time-select
                          v-model="begintime"
                          start="08:30"
                          step="00:15"
                          end="18:30"
                          style="width: 150px"
                          placeholder="起始时间"
                        >
                        </el-time-select>
                      </el-form-item>
                    </el-col>
                    <el-col class="line" :span="2"> -- </el-col>
                    <el-col :span="11">
                      <el-form-item prop="date2">
                        <span></span>
                        <el-time-select
                          v-model="endtime"
                          start="08:30"
                          step="00:15"
                          end="18:30"
                          style="width: 150px"
                          placeholder="结束时间"
                        >
                        </el-time-select>
                      </el-form-item>
                    </el-col>
                  </el-form-item>
                </div>
              </div>
              <div class="nanc" v-show="nangao2">
                <div class="nanzi"><font color="red">*</font> 星期选择</div>
                <div class="nan2">
                  <el-form-item required>
                    <el-checkbox-group v-model="week">
                      <el-checkbox label="7" @change="ar">星期日</el-checkbox>
                      <el-checkbox label="1" @change="a1">星期一</el-checkbox>
                      <el-checkbox label="2" @change="a2">星期二</el-checkbox>
                      <el-checkbox label="3" @change="a3">星期三</el-checkbox>
                      <el-checkbox label="4" @change="a4">星期四</el-checkbox>
                      <el-checkbox label="5" @change="a5">星期五</el-checkbox>
                      <el-checkbox label="6" @change="a6">星期六</el-checkbox>
                    </el-checkbox-group>
                  </el-form-item>
                </div>
              </div>
              <div class="nancc">
                <div class="nancc5" v-show="xqr">
                  <div class="nanzi">周日时间</div>
                  <div class="nan2">
                    <el-form-item label="" required>
                      <el-col :span="11">
                        <el-form-item prop="date1">
                          <el-time-select
                            v-model="begintime7"
                            start="08:30"
                            step="00:15"
                            end="18:30"
                            style="width: 150px"
                          >
                          </el-time-select>
                        </el-form-item>
                      </el-col>
                      <el-col class="line" :span="2">-</el-col>
                      <el-col :span="11">
                        <el-form-item prop="date2">
                          <span></span>
                          <el-time-select
                            v-model="endtime7"
                            start="08:30"
                            step="00:15"
                            end="18:30"
                            style="width: 150px"
                          >
                          </el-time-select>
                        </el-form-item>
                      </el-col>
                    </el-form-item>
                  </div>
                </div>
                <div class="nancc5" v-show="xq1">
                  <div class="nanzi">周一时间</div>
                  <div class="nan2">
                    <el-form-item label="" required>
                      <el-col :span="11">
                        <el-form-item prop="date1">
                          <el-time-select
                            v-model="begintime1"
                            start="08:30"
                            step="00:15"
                            end="18:30"
                            style="width: 150px"
                          >
                          </el-time-select>
                        </el-form-item>
                      </el-col>
                      <el-col class="line" :span="2">-</el-col>
                      <el-col :span="11">
                        <el-form-item prop="date2">
                          <span></span>
                          <el-time-select
                            v-model="endtime1"
                            start="08:30"
                            step="00:15"
                            end="18:30"
                            style="width: 150px"
                          >
                          </el-time-select>
                        </el-form-item>
                      </el-col>
                    </el-form-item>
                  </div>
                </div>
                <div class="nancc5" v-show="xq2">
                  <div class="nanzi">周二时间</div>
                  <div class="nan2">
                    <el-form-item label="" required>
                      <el-col :span="11">
                        <el-form-item prop="date1">
                          <el-time-select
                            v-model="begintime2"
                            start="08:30"
                            step="00:15"
                            end="18:30"
                            style="width: 150px"
                          >
                          </el-time-select>
                        </el-form-item>
                      </el-col>
                      <el-col class="line" :span="2">-</el-col>
                      <el-col :span="11">
                        <el-form-item prop="date2">
                          <span></span>
                          <el-time-select
                            v-model="endtime2"
                            start="08:30"
                            step="00:15"
                            end="18:30"
                            style="width: 150px"
                          >
                          </el-time-select>
                        </el-form-item>
                      </el-col>
                    </el-form-item>
                  </div>
                </div>
                <div class="nancc5" v-show="xq3">
                  <div class="nanzi">周三时间</div>
                  <div class="nan2">
                    <el-form-item label="" required>
                      <el-col :span="11">
                        <el-form-item prop="date1">
                          <el-time-select
                            v-model="begintime3"
                            start="08:30"
                            step="00:15"
                            end="18:30"
                            style="width: 150px"
                          >
                          </el-time-select>
                        </el-form-item>
                      </el-col>
                      <el-col class="line" :span="2">-</el-col>
                      <el-col :span="11">
                        <el-form-item prop="date2">
                          <span></span>
                          <el-time-select
                            v-model="endtime3"
                            start="08:30"
                            step="00:15"
                            end="18:30"
                            style="width: 150px"
                          >
                          </el-time-select>
                        </el-form-item>
                      </el-col>
                    </el-form-item>
                  </div>
                </div>
                <div class="nancc5" v-show="xq4">
                  <div class="nanzi">周四时间</div>
                  <div class="nan2">
                    <el-form-item label="" required>
                      <el-col :span="11">
                        <el-form-item prop="date1">
                          <el-time-select
                            v-model="begintime4"
                            start="08:30"
                            step="00:15"
                            end="18:30"
                            style="width: 150px"
                          >
                          </el-time-select>
                        </el-form-item>
                      </el-col>
                      <el-col class="line" :span="2">-</el-col>
                      <el-col :span="11">
                        <el-form-item prop="date2">
                          <span></span>
                          <el-time-select
                            v-model="endtime4"
                            start="08:30"
                            step="00:15"
                            end="18:30"
                            style="width: 150px"
                          >
                          </el-time-select>
                        </el-form-item>
                      </el-col>
                    </el-form-item>
                  </div>
                </div>
                <div class="nancc5" v-show="xq5">
                  <div class="nanzi">周五时间</div>
                  <div class="nan2">
                    <el-form-item label="" required>
                      <el-col :span="11">
                        <el-form-item prop="date1">
                          <el-time-select
                            v-model="begintime5"
                            start="08:30"
                            step="00:15"
                            end="18:30"
                            style="width: 150px"
                          >
                          </el-time-select>
                        </el-form-item>
                      </el-col>
                      <el-col class="line" :span="2">-</el-col>
                      <el-col :span="11">
                        <el-form-item prop="date2">
                          <span></span>
                          <el-time-select
                            v-model="endtime5"
                            start="08:30"
                            step="00:15"
                            end="18:30"
                            style="width: 150px"
                          >
                          </el-time-select>
                        </el-form-item>
                      </el-col>
                    </el-form-item>
                  </div>
                </div>
                <div class="nancc5" v-show="xq6">
                  <div class="nanzi">周六时间</div>
                  <div class="nan2">
                    <el-form-item label="" required>
                      <el-col :span="11">
                        <el-form-item prop="date1">
                          <el-time-select
                            v-model="begintime6"
                            start="08:30"
                            step="00:15"
                            end="18:30"
                            style="width: 150px"
                          >
                          </el-time-select>
                        </el-form-item>
                      </el-col>
                      <el-col class="line" :span="2">-</el-col>
                      <el-col :span="11">
                        <el-form-item prop="date2">
                          <span></span>
                          <el-time-select
                            v-model="endtime6"
                            start="08:30"
                            step="00:15"
                            end="18:30"
                            style="width: 150px"
                          >
                          </el-time-select>
                        </el-form-item>
                      </el-col>
                    </el-form-item>
                  </div>
                </div>
              </div>
            </el-form>
            <!-- <div class="nand">
          <div class="nand1">选择学员(100)</div>
          <div class="nand2 el-icon-user">添加学员</div>
        </div> -->
          </el-row>
          <div class="dialog-footera">
            <el-button
              style="width: 150px"
              type="primary"
              @click="oneadd('inserform')"
              >保存</el-button
            >
          </div>
          <!-- 批量排课 -->
        </el-tab-pane>
        <!-- 一对一排课 -->
      </el-tabs>
    </el-dialog>
    <!-- 学员排课 -->
  </div>
  <!-- 头部导航 -->
</template>

<script>
export default {
  data() {
    return {
      activeIndex: "1",
      queryinfo: {
        name: "",
        companyid: "",
        psize: 8,
        page: 1,
      },
      radioaaa: "",
      student: [],
      total: [],
      studentsousuo: [],
      audit: [],
      beibi: [],
      tableData: [],
      multipleSelection: [],
      studentnan: [], //插班排课获取学员id
      classid: "", //插班班级id
      teacher1: [], //请求主教老师、
      teacher2: [], //请求助教老师
      labelPosition: "top",
      labelPositiona: "left",
      dialogFormVisibles: false,
      dialogFormVisible: false,
      dialogFormVisiblec: false,
      dialogFormVisibleb: false,
      dialogFormVisiblebb: false,
      dialogFormVisibleabc: false,
      activeName: "first",
      radio: "1",
      buhuigao: false,
      buhui1: false,
      buhui2: false,
      nangao1: true,
      jieshu: false,
      nangao2: false,
      xqr: false,
      xq1: false,
      xq2: false,
      xq3: false,
      xq4: false,
      xq5: false,
      xq6: false,
      nan: "",
      labelPosition: "top",
      formaa: {
        name: "",
      },
      abc2: true,
      abc1: false,
      activeName: "first",
      value: new Date(),
      // radio: "1",
      // radio1: "2",
      // 购课
      gkform: {
        studentid: "",
        ordertype: "课时卡",
        beigindate: "",
        enddate: "",
        courseid: "",
        coursecounts: "2",
        price: "50",
        sumprice: "100",
        discounttype: "折扣",
        discountper: "90",
        discountprice: "11",
        remarks: "",
      },
      zhijian: "",
      youhui: "",
      // 购课
      editform: {
        id: "",
        name: "",
        tel: "",
        sex: "",
        birthday: "",
        num: "",
        remarks: "",
      },
      addform: {
        companyid: "",
        name: "",
        tel: "",
        sex: "",
        birthday: "",
        num: "",
        remarks: "",
      },
      gbzt: {
        id: "",
        name: "",
        state: "",
      },
      // 一对一排课
      oneform: {
        studentid: "",
        addtype: "one",
        jsfs: "按课节",
        classid: "",
        courseid: "",
        teacherid: "",
        assistant: "",
        classrooms: "",
        pricecounts: "",
        begindate: "",
        coursescount: "",
        enddate: "",
        weektime: [],
        studentlist: [],
      },
      week: [],
      begintime: "",
      endtime: "",
      begintime7: "",
      endtime7: "",
      begintime1: "",
      endtime1: "",
      begintime2: "",
      endtime2: "",
      begintime3: "",
      endtime3: "",
      begintime4: "",
      endtime4: "",
      begintime5: "",
      endtime5: "",
      begintime6: "",
      endtime6: "",
      // 请求主教老师1
      info1: {
        cat: "1",
      },
      // 请求主教老师1
      // 请求助老师2
      info2: {
        cat: "2",
      },
      // 请求助教老师2
      // 一对一排课
      // 教室
      class1: [],
      // 教室
      //课表左侧赋值
      kbiao: [],
      studentid: "",
      orderLista: [],
      zong: [], //课时汇总
      //课表左侧赋值
      rules: {
        name: [
          { required: true, message: "请输入姓名", trigger: "blur" },
          { min: 3, max: 6, message: "长度在 3 到 5 个字符", trigger: "blur" },
        ],
        tel: [
          { required: true, message: "请输入手机号", trigger: "blur" },
          { min: 11, max: 11, message: "请输入11个字符", trigger: "blur" },
        ],
        birthday: [{ required: true, message: "请选择日期", trigger: "blur" }],
        num: [
          { required: true, message: "请输入编号", trigger: "blur" },
          { min: 3, max: 15, message: "长度在 3 到 5 个字符", trigger: "blur" },
        ],
        remarks: [{ required: true, message: "请填写备注", trigger: "blur" }],
      },
    };
  },
  created() {
    this.studentList();
    this.studentss();
    this.gkList();
    this.kexhList();
    this.cbList();
    this.teachera();
    this.teacherb();
    this.classa();
  },
  computed: {
    zhijian: function () {
      if (this.abc2 == true) {
        // 折扣
        let discountper = "0." + this.gkform.discountper;
        let sumprice = this.gkform.sumprice;
        return (this.zhijian = sumprice * discountper);
        // 折扣
      } else {
        // 优惠
        let discountprice = this.gkform.discountprice;
        let sumprice = this.gkform.sumprice;
        return (this.zhijian = sumprice - discountprice);
        // 优惠
      }
    },
    youhui: function () {
      if (this.abc2 == true) {
        // 折扣
        let discountper = "0." + this.gkform.discountper;
        let sumprice = this.gkform.sumprice;
        let youhuia = discountper * sumprice;
        return (this.youhui = sumprice - youhuia);
        // 折扣
      } else {
        // 优惠
        let discountprice = this.gkform.discountprice;
        return (this.youhui = discountprice);
        // 优惠
      }
    },
  },

  methods: {
    async buhui() {
      const { data: res } = await this.$http.get(
        "http://www.eshareedu.cn/edusystems/api/students/searchForConsumed",
        { params: this.formaa }
      );
      // console.log(res);
      if (res.errCode == "10000") {
        this.studentList();
      }
    },
    // 请求学生数据
    async studentList() {
      // let token = window.sessionStorage.getItem("success_token");
      // console.log(token);
      const { data: res } = await this.$http.get(
        "http://www.eshareedu.cn/edusystems/api/students/searchForConsumed",
        { params: this.queryinfo }
      );
      // console.log(res);
      if ((res.code = "10000")) {
        this.student = res.data.list;
        this.total = res.data.counts;
      } else {
        this.$message.error("请求数据失败");
      }
    },
    // async studentList() {
    //   const { data: res } = await this.$http.get(
    //     "http://www.eshareedu.cn/edusystems/api/classes/list",
    //     { params: this.formaa }
    //   );
    //   console.log(res);
    //   if (res.errCode == "10000") {
    //     this.studentsousuo = res.data.list;
    //   } else {
    //     this.$message.error("搜索请求数据失败");
    //   }
    // },
    // 请求学生数据
    // 分页
    handleSizeChange(val) {
      // console.log(`每页 ${val} 条`);
      this.queryinfo.psize = val;
      this.studentList();
    },
    handleCurrentChange(val) {
      this.queryinfo.page = val;
      this.studentList();
      // console.log(`当前页: ${val}`);
    },
    // 分页结束
    // 添加
    async studentform(inserform) {
      let flag = false;
      this.$refs[inserform].validate((res) => {
        if (res == false) {
          flag = true;
        }
      });
      if (flag) {
        return;
      }
      let token = window.sessionStorage.getItem("success_token");
      // console.log(token);
      // 发起网络请求
      const { data: res } = await this.$http.post(
        "http://www.eshareedu.cn/edusystems/api/students/add",
        this.addform
      );
      // console.log(res);
      if ((res.errCode = "10000")) {
        this.$message.success("添加成功");
        this.dialogFormVisible = false;
        this.studentList();
      } else {
        this.$message.error("添加失败");
        this.studentList();
      }
      // 发起网络请求
    },
    //添加
    //删除
    async studentDelete(id) {
      // console.log(res)
      const result = await this.$confirm(
        "此操作将永久删除该记录, 是否继续?",
        "提示",
        {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        }
      ).catch((error) => {
        return error;
      });
      if (result == "confirm") {
        const { data: res } = await this.$http.get(
          "http://www.eshareedu.cn/edusystems/api/students/delete",
          { params: { id: id } }
        );
        // console.log(res);
        if (!res.errCode == "10000") {
          this.$message.error("删除失败");
        } else {
          this.$message.success("删除成功");
          this.studentList();
        }
        if (result == "cancel") {
          this.$message.info("已取消删除");
        }
      }
    },
    //删除
    //批量删除
    handleSelectionChange(val) {
      this.oneform.studentlist = val;
      this.multipleSelection = val;
      // this.multipleSelection.forEach((item) => {
      //   this.studentnan = item.id;
      // var students = new Array();
      // students["id"] = item.id;
      // var json = JSON.stringify(students);
      // this.studentnan.push(students);
      // });
      // console.log(val);
    },
    async psstuden() {
      let student_id = [];
      this.multipleSelection.forEach((item) => {
        student_id.push(item.id);
        // console.log(item.id);
      });
      const result = await this.$confirm(
        "此操作将永久删除该记录，是否继续？",
        "提示",
        {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        }
      ).catch((error) => {
        return error;
      });
      //点击确定是 confirm
      if (result == "confirm") {
        let idss = student_id.join(",");
        //发起网络请求
        const { data: res } = await this.$http.post(
          "http://www.eshareedu.cn/edusystems/api/students/deleteall",
          { ids: idss }
        );
        // console.log(res);
        if (res.errCode == "10000") {
          this.$message.success("删除成功");
          this.studentList();
        } else {
          this.$message.error("删除失败");
        }
      }
    },
    // 批量删除
    //学生修改表单赋值
    studenedit(val) {
      this.dialogFormVisibles = true;
      this.editform.id = val.id;
      this.student.forEach((item) => {
        if (val.id == item.id) {
          this.editform.name = item.name;
          this.editform.tel = item.tel;
          this.editform.sex = item.sex;
          this.editform.birthday = item.birthday;
          this.editform.num = item.num;
          this.editform.remarks = item.remarks;
        }
      });
    },
    //学生修改表单赋值
    //学生编辑
    async studentedit() {
      const { data: res } = await this.$http.post(
        "http://www.eshareedu.cn/edusystems/api/students/add",
        this.editform
      );
      // console.log(res);
      if (res.errCode == "10000") {
        this.$message.success("修改成功");
        this.studentList();
        this.dialogFormVisibles = false;
      } else {
        this.$message.error("修改失败");
      }
    },
    //学生编辑
    //学员搜索
    async studentss() {
      const { data: res } = await this.$http.get(
        "http://www.eshareedu.cn/edusystems/api/classes/list",
        { params: this.formaa }
      );
      // console.log(res);
      if (res.errCode == "10000") {
        this.studentsousuo = res.data.list;
      } else {
        this.$message.error("搜索请求数据失败");
      }
    },
    //学员搜索
    //请求课程数据购课
    async gkList() {
      const { data: res } = await this.$http.get(
        "http://www.eshareedu.cn/edusystems/api/courses/list"
      );
      // console.log(res);
      if (res.errCode == "10000") {
        this.audit = res.data.list;
      } else {
        this.$message.error("请求课程数据失败");
      }
    },
    //请求课程数据购课
    //计算金额
    // goukejs() {
    // if (this.abc2 == true) {
    //   // 折扣
    //   let discountper = "0." + this.gkform.discountper;
    //   console.log(discountper);
    //   let sumprice = this.gkform.sumprice;
    //   let youhuia = discountper * sumprice;
    //   this.youhui = sumprice - youhuia;
    //   this.zhijian = sumprice * discountper;
    //   // 折扣
    // } else if(this.abc1 == true) {
    //   // 优惠
    //   let discountprice = this.gkform.discountprice;
    //   let sumprice = this.gkform.sumprice;
    //   this.zhijian = sumprice - discountprice;
    //   this.youhui = discountprice;
    //   // 优惠
    // }
    // console.log(sumprice);
    // console.log(discountprice);
    // },
    qian() {
      // let total = this.gkform.price;
      let coursecounts = this.gkform.coursecounts;
      let price = this.gkform.price;
      this.gkform.sumprice = coursecounts * price;
    },
    // 计算金额
    //课表
    async kebiao(row) {
      this.studentid = row.id;
      let studentid=this.studentid
      this.kbiao = row;
      this.dialogFormVisiblec = true;
      const { data: res } = await this.$http.get(
        "http://www.eshareedu.cn/edusystems/api/coursetables/search",
        { params:{studentid:studentid}}
      );
      // console.log(res);
      if (res.errCode == "10000") {
        this.zong = res.data.list;
      }
    },
    // 课表
    // 购课
    gouke(id) {
      // console.log(id);
      this.gkform.studentid = id;
      // console.log(this.gkform.studentid);
      // console.log(id);
      this.dialogFormVisibleb = true;
    },
    // 购课
    //购课添加
    async shuai() {
      const { data: res } = await this.$http.post(
        "http://www.eshareedu.cn/edusystems/api/students/addorder",
        this.gkform
      );
      if (res.errCode == "10000") {
        this.$message.success("购课成功");
        this.studentList();
        this.dialogFormVisibleb = false;
      } else {
        this.$message.error("购课失败");
        this.dialogFormVisibleb = false;
      }
      // console.log(this.gkform);
      // console.log(res);
    },
    // 购课添加
    //单选变动
    button220() {
      this.abc2 = true;
      this.abc1 = false;
    },
    button110() {
      this.abc1 = true;
      this.abc2 = false;
    },
    //单选变动
    //课时消耗
    async kexhList() {
      const { data: res } = await this.$http.get(
        "http://www.eshareedu.cn/edusystems/api/students/searchForConsumed"
      );
      // console.log(res.data.list);
      if (res.errCode == "10000") {
        this.beibi = res.data.list.orderList;
      }
    },
    // 课时消耗
    //状态改变
    wan(row) {
      // console.log(row);
      this.dialogFormVisiblebb = true;
      this.gbzt.name = row.name;
      this.gbzt.id = row.id;
    },
    async editzt() {
      const { data: res } = await this.$http.get(
        "http://www.eshareedu.cn/edusystems/api/students/updateState",
        { params: this.gbzt }
      );
      // console.log(res);
      if (res.errCode == "10000") {
        this.$message.success("删除成功");
        this.dialogFormVisiblebb = false;
        this.studentList();
      } else {
        this.$message.error("删除失败");
      }
    },
    //状态改变
    //排课
    paike(row) {
      this.dialogFormVisibleb = true;
    },
    //排课
    //助教显示隐藏
    none() {
      this.buhuigao = !this.buhuigao;
      // console.log(123);
    },
    //助教显示隐藏
    //批量排课
    none1() {
      this.oneform.addtype = "more";
      this.buhui1 = true;
      this.buhui2 = true;
      // console.log(123);
    },
    none11() {
      this.jieshu = false;
      this.oneform.addtype = "one";
      this.week = 0;
      this.buhui1 = false;
      this.buhui2 = false;
      // console.log(123);
    },
    // 批量排课
    //单选框1
    button1() {
      this.nangao1 = true;
      this.buhui2 = true;
      this.jieshu = false;
      this.nangao2 = false;
    },
    // 单选框1
    // 单选框2
    button2() {
      this.nangao1 = false;
      this.buhui2 = false;
      this.jieshu = true;
      this.nangao2 = true;
    },
    // 单选框2
    //复选框弹出时间选择
    ar() {
      this.xqr = !this.xqr;
      // alert(123)
    },
    a1() {
      this.xq1 = !this.xq1;
      // alert(123)
    },
    a2() {
      this.xq2 = !this.xq2;
      // alert(123)
    },
    a3() {
      this.xq3 = !this.xq3;
      // alert(123)
    },
    a4() {
      this.xq4 = !this.xq4;
      // alert(123)
    },
    a5() {
      this.xq5 = !this.xq5;
      // alert(123)
    },
    a6() {
      this.xq6 = !this.xq6;
      // alert(123)
    },
    //课表
    //插班排课
    async cbList() {
      const { data: res } = await this.$http.get(
        "http://www.eshareedu.cn/edusystems/api/classes/list"
      );
      // console.log(res);
      if (res.errCode == "10000") {
        this.tableData = res.data.list;
      } else {
        this.$message.error("插班排课请求数据失败");
      }
    },
    // 插班排课
    //插班排课添加
    // 获取班级id
    course() {
      if (this.multipleSelection.length == "") {
        this.$message.error("请选学员再添加排课");
        return;
      }
      this.dialogFormVisibleabc = true;
    },
    // 获取班级id
    szyzs(row) {
      this.classid = row.id;
      console.log(row);
    },
    async banjipk() {
      let id = [];
      this.multipleSelection.forEach((item) => {
        id.push({ id: item.id });
      });
      // console.log(id);
      let classid = this.classid;
      // console.log({ classid: classid, studentlist: { id: id } })
      const { data: res } = await this.$http.post(
        "http://www.eshareedu.cn/edusystems/api/coursetables/addForClassid",
        { classid: classid, studentlist: id }
      );
      if (res.errCode == "10000") {
        this.$message.success("学员排课成功");
        this.studentList();
        this.dialogFormVisibleabc = false;
      } else {
        this.$message.error("学员排课失败");
      }
    },
    //插班排课添加
    //请求讲师数据
    async teachera() {
      const { data: res } = await this.$http.get(
        "http://www.eshareedu.cn/edusystems/api/teachers/list",
        { params: this.info1 }
      );
      // console.log(res);
      if (res.errCode == "10000") {
        this.teacher1 = res.data.list;
      }
    },
    //请求讲师数据
    //请求助教讲师数据
    async teacherb() {
      const { data: res } = await this.$http.get(
        "http://www.eshareedu.cn/edusystems/api/teachers/list",
        { params: this.info2 }
      );
      // console.log(res);
      if (res.errCode == "10000") {
        this.teacher2 = res.data.list;
      }
    },
    //请求助教讲师数据
    // 请求教室数据
    async classa() {
      const { data: res } = await this.$http.get(
        "http://www.eshareedu.cn/edusystems/api/classrooms/list"
      );
      // console.log(res);
      if (res.errCode == "10000") {
        this.class1 = res.data.list;
      }
    },
    // 请求教室数据
    //一对一排课只能给一个学生排课
    nihaoa(activeName, oldActiveName) {
      if (activeName == "second") {
        if (this.multipleSelection.length > 1) {
          this.$message.error("一对一排课尽仅可以添加一个学生");
          return false;
        }
      }
    },
    //一对一排课只能给一个学生排课
    //一对一添加
    async oneadd() {
      // 获取学生id
      this.multipleSelection.forEach((item) => {
        this.oneform.studentid = item.id;
      });
      // 获取学生id
      // 单次排课
      if (this.week == 0) {
        let asc = { week: 0, begintime: this.begintime, endtime: this.endtime };
        this.oneform.weektime.push(asc);
      }
      // 单次排课
      // 批量排课
      this.week.forEach((item) => {
        if (item == 7) {
          let asc = {
            week: 7,
            begintime: this.begintime7,
            endtime: this.endtime7,
          };
          this.oneform.weektime.push(asc);
        }
        if (item == 1) {
          let asc = {
            week: 1,
            begintime: this.begintime1,
            endtime: this.endtime1,
          };
          this.oneform.weektime.push(asc);
        }
        if (item == 2) {
          let asc = {
            week: 2,
            begintime: this.begintime2,
            endtime: this.endtime2,
          };
          this.oneform.weektime.push(asc);
        }
        if (item == 3) {
          let asc = {
            week: 3,
            begintime: this.begintime3,
            endtime: this.endtime3,
          };
          this.oneform.weektime.push(asc);
        }
        if (item == 4) {
          let asc = {
            week: 4,
            begintime: this.begintime4,
            endtime: this.endtime4,
          };
          this.oneform.weektime.push(asc);
        }
        if (item == 5) {
          let asc = {
            week: 5,
            begintime: this.begintime5,
            endtime: this.endtime5,
          };
          this.oneform.weektime.push(asc);
        }
        if (item == 5) {
          let asc = {
            week: 5,
            begintime: this.begintime5,
            endtime: this.endtime5,
          };
          this.oneform.weektime.push(asc);
        }
        if (item == 6) {
          let asc = {
            week: 6,
            begintime: this.begintime6,
            endtime: this.endtime6,
          };
          this.oneform.weektime.push(asc);
        }
      });
      // 批量排课
      const { data: res } = await this.$http.post(
        "http://www.eshareedu.cn/edusystems/api/coursetables/add",
        this.oneform
      );
      // console.log(res);
      if ((res.errCode = "10000")) {
        this.$message.success("学员一对一排课成功");
        this.studentList();
        this.dialogFormVisibleabc = false;
      } else {
        this.$message.error("学员排课失败");
      }
      ``;
    },
    //一对一添加
  },
};
</script>



<style lang="less" scoped>
.box {
  width: 100%;
}

.top {
  height: 60px;
  //   background-color: aqua;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
  display: flex;
}

.nan1 {
  font-size: 12px;
  color: #419efe;
  // margin-left: 20px;
  cursor: pointer;
}

.nan2 {
  font-size: 12px;
  color: #419efe;
  margin-left: 20px;
  cursor: pointer;
}

.top .top1 {
  width: 145px;
  height: 50px;
  //   background-color: rgb(219, 219, 219);
  border-radius: 100px;
  margin-top: 5px;
  font-weight: bold;
  span {
    display: block;
    text-align: center;
    line-height: 50px;
    font-size: 20px;
  }
}

.top .top2 {
  width: 110px;
  height: 40px;
  // background-color: blue;
  margin-top: 10px;
  margin-left: 30px;
}

.top .top22 {
  width: 515px;
  height: 40px;
}

.block {
  margin-top: 10px;
  margin-left: 300px;
}
.boxcenter {
  width: 100%;
}
.sss {
  width: 100%;
  display: flex;
  .kebiao1 {
    width: 22.8%;
    background-color: #f4f7ff;
    border-radius: 4px;
    margin-top: -30px;
    .kb-left {
      width: 280px;
      margin: auto;
      height: 55px;
      background-color: #1890ff;
      border-top-left-radius: 8px;
      border-top-right-radius: 8px;
      span {
        line-height: 55px;
        color: #fff;
        margin-left: 20px;
      }
    }
    .kb-lefta {
      width: 280px;
      height: 290px;
      margin: auto;
      margin-top: 15px;
      background-color: rgb(255, 255, 255);
      .frist {
        width: 240px;
        height: 40px;
        // background-color: blue;
        margin: auto;
        display: flex;
        .left-img {
          width: 40px;
          height: 40px;
          background-color: red;
          border-radius: 8px;
          img {
            width: 100%;
            height: 100%;
            border-radius: 8px;
          }
        }
        span {
          font-size: 20px;
          color: #606266;
          line-height: 40px;
          margin-left: 10px;
        }
      }
      .frist2 {
        width: 240px;
        height: 24px;
        margin: auto;
        margin-top: 10px;
        // background-color: blue;
        span {
          line-height: 24px;
        }
        button {
          width: 54px;
          height: 24px;
          border-radius: 3px;
          background-color: #ebebeb;
          font-size: 12px;
          color: #909399;
          border: 1px rgb(187, 187, 187) solid;
        }
        button:hover {
          background-color: #909399;
          color: #fff;
        }
      }
      .acc {
        width: 240px;
        height: 20px;
        margin-top: 15px;
        // background-color: blueviolet;
        line-height: 20px;
        color: #606266;
        margin-left: 20px;
        // margin: auto;
      }
    }
    .kb-leftb {
      width: 280px;
      height: 226px;
      margin: auto;
      background-color: rgb(255, 255, 255);
      margin-top: 20px;
      .leftb-biaoti {
        width: 240px;
        height: 40px;
        // background-color: cadetblue;
        margin-left: 20px;
        line-height: 50px;
      }
      .kb-leftc {
        width: 240px;
        height: 64px;
        margin-left: 20px;
        margin-top: 5px;
        // background-color: chartreuse;
        border-bottom: 1px solid rgb(230, 230, 230);
        .leftc1 {
          width: 240px;
          height: 16px;
          // background-color: red;
          line-height: 16px;
          font-size: 12px;
          margin-top: 20px;
          margin-bottom: 5px;
        }
        .leftc2 {
          width: 240px;
          height: 16px;
          // background-color: cornflowerblue;
          .left22 {
            width: 240px;
            height: 6px;
            line-height: 16px;
            background-color: #d6eaf5;
          }
        }
        .leftc3 {
          width: 240px;
          height: 16px;
          // background-color: rgb(0, 0, 0);
          margin-top: -3px;
          display: flex;
          justify-content: space-between;
          span {
            font-size: 12px;
          }
        }
      }
    }
  }
  .kebiaorl {
    width: 75%;
    height: 800px;
    margin-top: -35px;
    margin-left: 10px;
    // background-color: darkorange;
    .kebiaorl1 {
      width: 100%;
      height: 60px;
      // background-color: aqua;
      .rili {
        width: 100%;
      }
    }
  }
}
//购课
.audit {
  width: 100%;
  height: 490px;
  margin-top: -30px;
  // background-color: cornflowerblue;
  .audita {
    margin-top: 10px;
    width: 900px;
    height: 90px;
    // background-color: rgb(245, 245, 245);
    display: flex;
    .audita1 {
      width: 220px;
      height: 90px;
      // background-color: cyan;
      .nan2 {
        color: #626866;
      }
    }
  }
  .audita111 {
    margin-top: 10px;
    width: 900px;
    height: 120px;
    // background-color: rgb(245, 245, 245);
    display: flex;
    border-bottom: 1px #e7e7e7 solid;
    .audita1 {
      width: 220px;
      height: 90px;
      // background-color: cyan;
      .nan2 {
        color: #626866;
      }
    }
  }
}
.buhuia {
  width: 100%;
  height: 0px;
  // background-color: cyan;
  display: flex;
  margin-left: 20px;
  .zhenbuhui {
    // width: 1000px;
    margin-left: 25px;
    height: 50px;
    font-weight: bold;
    line-height: 50px;
    span {
      font-weight: bold;
      color: #ff0000;
    }
  }
}
.aaa {
  width: 24px;
  height: 20px;
  line-height: 20px;
  // background-color: aquamarine;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.ccc {
  width: 48px;
  height: 24px;
  background-color: blue;
}
.nangao {
  margin-top: -40px;
  font-size: 18px;
  color: #303133;
}
.acc {
  // margin-left: 0px;
  margin-top: 50px;
  // margin-bottom: -100px;
  font-weight: bold;
  color: black;
  // background-color: aqua;
}
//排课
.nan {
  width: 1025px;
  height: 90px;
  margin-top: 20px;
  // background-color: aqua;
  display: flex;
  .nan2 {
    width: 160px;
    margin-left: 40px;
    height: 87px;
    // background-color: aquamarine;
    span {
      // display: block;
      font-size: 15px;
      color: #000;
      margin-bottom: 10px;
      // color: #15b0ff;
    }
  }
}
.nana {
  width: 200px;
  height: 59px;
  // background-color: bisque;
  margin-top: 20px;
  margin-left: 25px;
}
.nanb {
  width: 999px;
  height: 88px;
  // background-color: blanchedalmond;
  margin-left: 30px;
  margin-top: 18px;
  display: flex;
  .nan2 {
    width: 210px;
    // margin-left: 40px;
    margin-left: 15px;
    height: 87px;
    // background-color: aquamarine;
    // span {
    //   // display: block;
    //   font-size: 15px;
    //   color: #000;
    //   margin-bottom: 10px;
    //   // color: #15b0ff;
    // }
  }
}
.nanc {
  width: 999px;
  height: 90px;
  margin-left: 45px;
  // background-color: blue;
  .nanzi {
    margin-top: 20px;
  }
  .nan2 {
    margin-top: 10px;
  }
}
.nand {
  width: 999px;
  height: 48px;
  // background-color: blueviolet;
  margin-left: 45px;
  display: flex;
  .nand1 {
    // width: 85px;
    // height: 22px;
    // background-color: red;
    font-size: 16.5px;
    font-weight: bold;
    color: #606266;
    line-height: 48px;
  }
  .nand2 {
    font-size: 14px;
    color: #4181fc;
    line-height: 48px;
    margin-left: 30px;
    cursor: pointer;
    // width: 72px;
    // height: 16px;
    // background-color: cadetblue;
  }
}
.nancc {
  width: 100%;
  margin-left: 45px;
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  .nancc5 {
    width: 450px;
    height: 100px;
    // background-color: rgb(101, 117, 84);
    .nanzi {
      color: #606266;
      font-size: 14px;
    }
    .nan2 {
      margin-top: 12px;
    }
  }
}
.aabbcc {
  margin-top: 10px;
  width: 190px;
  height: 80px;
  margin-left: 20px;
  span {
    color: #000000;
    font-size: 15px;
  }
  // background-color: aquamarine;
}

//插班排课添加按钮
.dialog-footer {
  margin-left: 1100px;
  margin-top: 50px;
}
.dialog-footera {
  margin-left: 950px;
}
//插班排课添加按钮
// 排课
// .buttonzt {
//   width: 83px;
//   height: 40px;
//   :hover {
//     width: 83px;
//     height: 40px;
//     background-color: rgb(25, 0, 255);
//     color: #fff;
//   }
// }
.acca {
  width: 90px;
  height: 45px;
  margin-top: 10px;
  background: rgb(245, 245, 245);
  border-radius: 4px;
  margin-left: 10px;
  display: flex;
  .accb {
    width: 5px;
    height: 45px;
    background-color: blue;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
  }
  .accc {
    width: 75px;
    height: 45px;
    // background-color: blueviolet;
    .accd {
      width: 75px;
      height: 15px;
      // background-color: burlywood;
      margin-top: 5px;
      font-size: 12px;
      margin-left: 5px;
      color: #000000;
    }
    .accd2 {
      width: 75px;
      height: 15px;
      margin-top: 5px;
      justify-content: space-between;
      // background-color: burlywood;
      span {
        font-size: 12px;
        color: #7c8c9c;
        margin-left: 5px;
      }
    }
  }
}
//购课
</style>